package com.yidu.best.bond.securitiesInventory.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yidu.best.bond.securitiesInventory.domain.SecuritiesInventoryVo;
import com.yidu.best.bond.securitiesInventory.service.SecuritiesInventoryService;

@Controller
@RequestMapping("/Bond/")
public class SecuritiesInventoryControllert {
	@Autowired
	private SecuritiesInventoryService  securitiesInventoryService;
	
	
	@RequestMapping("getSecuritiesInventory")
	public String getSecuritiesInventory() {
		return "bond/inventory/securitiesInventory";
	}
	
	
	@ResponseBody
	@RequestMapping(value = "SecuritiesInventory", method = RequestMethod.GET)
	public Map<String, Object> findPageQuery(SecuritiesInventoryVo securitiesInventoryVo) {
		Map<String, Object> map = securitiesInventoryService.findPageQuery(securitiesInventoryVo);
		return map;
	}
	
	@ResponseBody
	@RequestMapping(value = "SecuritiesInventory", method = RequestMethod.PUT)
	public boolean updateSecuritiesInventory(String securitiesInventoryId,String status) {
		return securitiesInventoryService.updateSecuritiesInventoryStatus(status, securitiesInventoryId);
	}
	
	@ResponseBody
	@RequestMapping(value = "ValueOfAssessment", method = RequestMethod.PUT)
	public boolean updateSecuritiesInventory(String securitiesInventoryId) {
		return securitiesInventoryService.updateSecuritiesInventory(securitiesInventoryId);
	}
}
